
#ifndef __SHAPE_H__
#define __SHAPE_H__

#include <gdiplus.h>

using namespace Gdiplus;

// +---+---------+---------+---------+---------+---------+---------+---------+
// |   |    A    |    B    |    C    |    D    |    E    |    F    |    G    |
// +   |---------+---------+---------+---------+---------+---------+---------+
// |   | 0 1 2 3 | 0 1 2 3 | 0 1 2 3 | 0 1 2 3 | 0 1 2 3 | 0 1 2 3 | 0 1 2 3 |
// +---+---------+---------+---------+---------+---------+---------+---------+
// | 0 |         |         |         |         |         |         |         |
// | 1 |         |   # #   | # #     |   #     |   # #   |   # #   |   # #   |
// | 2 | # # # # | # #     |   # #   | # # #   |   # #   |     #   |   #     |
// | 3 |         |         |         |         |         |     #   |   #     |
// +---+---------+---------+---------+---------+---------+---------+---------+

class CShape
{
public:
	enum enum_shape_types {
		typeA,
		typeB,
		typeC,
		typeD,
		typeE,
		typeF,
		typeG,
		TYPE_COUNT,
	};

	enum enum_direcitons {
		dirNorth,
		dirEast,
		dirSouth,
		dirWest
	};

	enum {
		SHAPE_WIDTH = 4
	};

private:
	int m_type;
	int m_direction;
	Color m_color;

public:
	BYTE m_buffer[SHAPE_WIDTH][SHAPE_WIDTH];

public:
	CShape();
	CShape(int type, int dir = dirNorth);

	int GetType();
	void SetType(int type);

	void Rotate(bool bLeft = true);
	int GetDirection();
	void SetDirection(int dir);

	Color GetColor();
	void SetColor(Color color);

	bool IsRowBlank(int row);
	bool IsColBlank(int col);
};

#endif
